<template>
<div class="school">
  <h1 v-text="msg" ref="title"></h1>
  <button @click="show">点我输出上方的DOM元素</button>
<School ref="sch"></School>
</div>
</template>

<script>
//引入组件
import School from './components/School.vue'
export default {
  name: "App",
  data(){
    return{
      msg:'欢迎来到！'
    }
  },
  components:{School},
  methods:{
    show(){
      console.log('@@' , this.$refs.title)//真实DOM元素
      console.log('@@',this.$refs.sch )//School组件的实例对象（vc)
    }
  }

}
</script>

<style scoped>

</style>